import pynvml
pynvml.nvmlInit()

deviceCount = pynvml.nvmlDeviceGetCount()
for i in range(deviceCount):
    handle = pynvml.nvmlDeviceGetHandleByIndex(i)
    print("Device", i, ":", pynvml.nvmlDeviceGetName(handle))